﻿#region Imports
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows;
using System;
using CheckerWPF.Utils;
using CheckerWPF.Converters;
using System.Threading;
using System.Windows.Media;
#endregion

namespace CheckerWPF.UserControls
{
    /// <summary>
    /// Interaction logic for uclOptionCheckerWPF.xaml
    /// </summary>
    public partial class uclOptionCheckerWPF : BaseUserControl
    {
        public uclOptionCheckerWPF(bool defaultValue)
        {
            InitializeComponent();

            chkOption.IsChecked = defaultValue;
        }

        #region Properties
        private int checkerHeight;
        public int CheckerHeight
        {
            get { return checkerHeight; }
            set { checkerHeight = value; RaisePropertyChanged("CheckerHeight"); }
        }

        private int checkeWidth;
        public int CheckeWidth
        {
            get { return checkeWidth; }
            set { checkeWidth = value; RaisePropertyChanged("CheckeWidth"); }
        }

        private string checkerText;
        public string CheckerText
        {
            get { return !String.IsNullOrEmpty(checkerText) ? checkerText : "Checker"; }
            set { checkerText = value; RaisePropertyChanged("CheckerText"); }
        }

        //private string optionY;
        //public string OptionY
        //{
        //    get { return !String.IsNullOrEmpty(optionY) ? optionY : "&Yes"; }
        //    set { optionY = value; RaisePropertyChanged("OptionY"); }
        //}

        public string OptionY
        {
            set { radOption10.Content = !String.IsNullOrEmpty(value) ? value : "&Yes"; }
        }

        public string OptionN
        {
            set { radOption20.Content = !String.IsNullOrEmpty(value) ? value : "&No"; ; }
        }


        /*
        public string OptionY
        {
            get { return (string)GetValue(OptionYProperty); }
            set { SetValue(OptionYProperty, value); RaisePropertyChanged("OptionY"); }
        }

        // Using a DependencyProperty as the backing store for OptionY.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty OptionYProperty =
            DependencyProperty.Register("OptionY", typeof(string), typeof(uclOptionCheckerWPF), new UIPropertyMetadata(""));

        private string optionN;
        public string OptionN
        {
            get { return !String.IsNullOrEmpty(optionN) ? optionN : "&No"; }
            set { optionN = value; RaisePropertyChanged("OptionN"); }
        }
        */
        #endregion

        private void chkOption_Checked(object sender, RoutedEventArgs e)
        {
            //TestConverter tst = new TestConverter();
            //bckTest.Background = (SolidColorBrush)tst.Convert(chkOption.IsChecked, null, null, Thread.CurrentThread.CurrentCulture);
        }
    }
}
